package beerAir;
import javax.persistence.*;

import java.util.Date;

@Entity
public class Flight {

	@Id
	private String number;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="arrivalAirport")
	private Airport arrivalAirport;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="departureAirport")
	private Airport departureAirport;
	
	@Temporal(TemporalType.DATE)
	private Date arrivalDate;
	private String arrivalTime;
	
	@Temporal(TemporalType.DATE)
	private Date departureDate;
	private String departureTime;
	private float travelPrice;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="id_plane")
	private Airplane plane;
	
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public Airport getArrivalAirport() {
		return arrivalAirport;
	}
	public void setArrivalAirport(Airport arrivalAirport) {
		this.arrivalAirport = arrivalAirport;
	}
	public Date getArrivalDate() {
		return arrivalDate;
	}
	public void setArrivalDate(Date arrivalDate) {
		this.arrivalDate = arrivalDate;
	}
	public String getArrivalTime() {
		return arrivalTime;
	}
	public void setArrivalTime(String arrivalTime) {
		this.arrivalTime = arrivalTime;
	}
	public Airport getDepartureAirport() {
		return departureAirport;
	}
	public void setDepartureAirport(Airport departureAirport) {
		this.departureAirport = departureAirport;
	}
	public Date getDepartureDate() {
		return departureDate;
	}
	public void setDepartureDate(Date departureDate) {
		this.departureDate = departureDate;
	}
	public String getDepartureTime() {
		return departureTime;
	}
	public void setDepartureTime(String departureTime) {
		this.departureTime = departureTime;
	}
	public float getTravelPrice() {
		return travelPrice;
	}
	public void setTravelPrice(float travelPrice) {
		this.travelPrice = travelPrice;
	}
	public Airplane getPlane() {
		return plane;
	}
	public void setPlane(Airplane plane) {
		this.plane = plane;
	}
}